package cn.pfz.config;

import com.jagregory.shiro.freemarker.ShiroTags;
import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

//Shiro 标签库配置类
public class MyFreeMarkConfinger extends FreeMarkerConfigurer {
    @Override
    public void afterPropertiesSet() throws IOException, TemplateException {
        super.afterPropertiesSet();
        Configuration configuration = this.getConfiguration();
        //1标识使用shrio 2声明是个标签
        configuration.setSharedVariable("shiro",new ShiroTags());

    }
}
